import { ipcRenderer, IpcRendererEvent } from 'electron';

class abi {
  send(change: string, ...args: any) {
    ipcRenderer.send(change, args);
  }
  sendSync(change: string, ...args: any) {
    ipcRenderer.sendSync(change, args);
  }
  on(
    change: string,
    listener: (event: IpcRendererEvent, ...args: any[]) => void
  ) {
    ipcRenderer.on(change, listener);
    }
  once(
    change: string,
    listener: (event: IpcRendererEvent, ...args: any[]) => void
  ) {
    ipcRenderer.once(change, listener);
  }
}

const ABI = new abi();
export default ABI;
